import HomePage from '../pages/HomePage.vue'
import AboutPage from '../pages/AboutPage.vue'
import ContactPage from '../pages/ContactPage.vue'
import PostListPage from '../pages/PostListPage.vue'
import PostDetailPage from '../pages/PostDetailPage.vue'
import CategoryPage from '../pages/CategoryPage.vue'
import TagPage from '../pages/TagPage.vue'
import SearchPage from '../pages/SearchPage.vue'
import ProfilePage from '../pages/ProfilePage.vue'

const routes = [
  { path: '/', component: HomePage },
  { path: '/about', component: AboutPage },
  { path: '/contact', component: ContactPage },
  { path: '/posts', component: PostListPage },
  { path: '/post/:id', component: PostDetailPage, props: true },
  { path: '/category/:name', component: CategoryPage, props: true },
  { path: '/tag/:name', component: TagPage, props: true },
  { path: '/search', component: SearchPage, props: route => ({ query: route.query.q }) },
  { path: '/profile', component: ProfilePage }
]

export default routes